<?php
namespace App\Repositories\GameServer;

use App\Models\GameServer\DaliyMission;

class DaliyMissionRepository
{
    //获取所有商品
    public function getDaliyMissions()
    {
        return DaliyMission::orderBy('listorder', 'desc')->get();
    }

    public function getDaliyMission($id)
    {
        return DaliyMission::find($id);
    }

    public function addDaliyMission($request)
    {
        $daliyMission = DaliyMission::create($request->all());

        return $daliyMission;
    }

    public function updateDaliyMission($request, $id)
    {
        return DaliyMission::find($id)->update($request->all());
    }

    public function deleteDaliyMission($id)
    {
        return DaliyMission::destroy($id);
    }
}